package com.lp.security.auth.controller;

import com.lp.common.utils.CommonResult;
import com.lp.security.auth.entity.LoginParams;
import com.lp.security.auth.service.AuthService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: hsc-yyx
 * @description:
 * @author: Ke.Song
 * @since: 2024-01-10 20:25:48
 */
@Slf4j
@RestController
@RequestMapping("/auth")
public class AuthController {

    @Autowired
    private AuthService authService;

    @PostMapping("/login")
    public CommonResult login(@RequestBody @Validated LoginParams loginParams) {
        return authService.login(loginParams);
    }
}
